<script setup lang="ts">
import { ref } from 'vue';

// 1. 简单类型，建议省略不写类型
// const money = ref(10000)
const money = ref<number>(10000)
const car = ref("宝马")

// 2. 复杂类型，建议写上类型
const list = ref<{
    id: number,
    name: string,
    done: boolean
}[]>([])

setTimeout(() => {
    list.value = [
        { id: 1, name: '吃饭', done: false },
        { id: 2, name: '睡觉', done: true }
    ]
}, 1000)

</script>

<template>
    <h1>Hello vue3 - {{ money }} - {{ car }}</h1>

    <div v-for="item in list" :key="item.id">{{ item.name }}</div>
</template>

<style scoped>
</style>